package com.qjz.diancan.mapper;


import com.qjz.diancan.model.entity.Cart;
import com.qjz.diancan.model.entity.Dish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zhu
 * @since 2024-02-14
 */
@Mapper
public interface CartMapper {

    void addShopCar(@Param("uid") Integer id, @Param("dish") Dish dish);

    List<Cart> findByPage(Integer id);

    @Delete("delete from cart where id = #{id}")
    void deleteShopCarData(Integer id);

    void updateShopCarData(Cart cart);

    void deleteShopCarDataAll(@Param("ids") List<Integer> ids, @Param("orderId") Integer orderId);

    List<Cart> findByOrderId(Integer id);
}
